// 公共设置key
let commonSettingKey = [
    { key: 'debugModel', type: "开关" },
    { key: 'debugSleep', type: "输入框" },
    { key: 'webSocketLog', type: "开关" },
    { key: '自动运行', type: "开关" },
    { key: '连续同一页面次数', type: "下拉框" },
    { key: '连续无匹配页面次数', type: "下拉框" },
    { key: "select业务", type: "下拉框" }
]

// 公共设置值域
let commonSettingRange = {
    "select业务": ["单人任务", "队伍任务", "极难任务"], // 业务名称值域列表
    "连续同一页面次数": [15, 20, 25, 30, 35, 40],
    "连续无匹配页面次数": [15, 20, 25, 30, 35, 40]
}


// 坐标偏移系数
let positionOffset = {
    "1080_1920": {// 标准分辨率不偏移
        "offsetX": 0,
        "offsetY": 0
    },
    "1080_2400": {
        "offsetX": 5,
        "offsetY": 0
    }
}

// 命名规则 pageSetting_ + 业务名称
let pageSetting_单人任务 = {
    "登录页": {
        "1080_2400": {
            "relation": { "total": "or", "analysisChart": "or", "multipleColor": "or", "multipleImg": "or" },
            "analysisChart": [{ "threshold": 60, "maxVal": 255, "imgThreshold": 0.7, "colorThreshold": 26, "bigScale": 1, "smallScale": 1, "isOpenGray": 0, "isOpenThreshold": 0, "position": ["886", "233", "1078", "297"], "featuresThreshold": 0.7, "context": "WAR", "matchingType": "contains", "canvasMsg": "WAR" }],
            "multipleColor": [],
            "multipleImg": []
        }
    },
    "游戏首页": {
        "1080_2400": {
            "relation": { "total": "or", "analysisChart": "or", "multipleColor": "or", "multipleImg": "or" },
            "analysisChart": [{ "threshold": "60", "maxVal": 255, "imgThreshold": 0.7, "colorThreshold": 26, "bigScale": 1, "smallScale": 1, "isOpenGray": 0, "isOpenThreshold": 0, "position": ["1966", "798", "2220", "1066"], "featuresThreshold": 0.7, "colorOther": [], "context": "出战", "matchingType": "contains" }],
            "multipleColor": [],
            "multipleImg": []
        }
    },
    "出战页": {
        "1080_2400": {
            "relation": { "total": "or", "analysisChart": "or", "multipleColor": "or", "multipleImg": "or" },
            "analysisChart": [{ "threshold": 60, "maxVal": 255, "imgThreshold": 0.7, "colorThreshold": 26, "bigScale": 1, "smallScale": 1, "context": "出战", "isOpenGray": 0, "isOpenThreshold": 0, "position": ["219", "6", "674", "109"], "featuresThreshold": 0.7, "colorOther": [], "matchingType": "contains", "canvasMsg": "出战" }],
            "multipleColor": [],
            "multipleImg": []
        }
    },
    "人工智能升级": {
        "1080_2400": {
            "relation": { "total": "or", "analysisChart": "or", "multipleColor": "or", "multipleImg": "or" },
            "analysisChart": [{ "threshold": 60, "maxVal": 255, "imgThreshold": 0.7, "colorThreshold": 26, "bigScale": 1, "smallScale": 1, "isOpenGray": 0, "isOpenThreshold": 0, "position": ["942", "32", "1468", "153"], "featuresThreshold": 0.7, "color": "#031E1D", "colorOther": [[526, 121, "#072C2C"]], "context": "人工智能", "matchingType": "contains", "canvasMsg": "人工智能" }],
            "multipleColor": [],
            "multipleImg": []
        }
    },
    "广告页": {
        "1080_2400": {
            "relation": { "total": "or", "analysisChart": "or", "multipleColor": "or", "multipleImg": "or" },
            "analysisChart": [],
            "multipleColor": [],
            "multipleImg": [{ "threshold": "60", "maxVal": 255, "imgThreshold": 0.7, "pathName": "./res/1080_2400/广告关闭.png", "colorThreshold": 26, "bigScale": 1, "smallScale": 1, "isOpenGray": 0, "isOpenThreshold": 0, "position": ["1586", "122", "1989", "409"], "featuresThreshold": 0.7 }, { "threshold": "220", "maxVal": 255, "imgThreshold": 0.7, "colorThreshold": 26, "bigScale": 1, "smallScale": 1, "isOpenGray": 0, "isOpenThreshold": 0, "position": ["1886", "891", "2145", "1071"], "featuresThreshold": 0.7, "pathName": "./res/1080_2400/广告关闭1.png" }]
        }
    },
    "签到奖励": {
        "1080_2400": {
            "relation": { "total": "or", "analysisChart": "or", "multipleColor": "or", "multipleImg": "or" },
            "analysisChart": [{ "threshold": 60, "maxVal": 255, "imgThreshold": 0.7, "colorThreshold": 26, "bigScale": 1, "smallScale": 1, "isOpenGray": 0, "isOpenThreshold": 0, "position": ["1049", "112", "1353", "223"], "featuresThreshold": 0.7, "colorOther": [], "context": "签到", "matchingType": "contains", "canvasMsg": "签到" }],
            "multipleColor": [],
            "multipleImg": []
        }
    }
}

// 命名规则 pageSetting_ + 业务名称
let pageSetting_队伍任务 = {
    "竞技场": {
        "1080_2400": {
            'relation': { "total": "or", "analysisChart": "or", "multipleColor": "or", "multipleImg": "or", "nextKey": "选择队伍_待开始" },
            'analysisChart': [{ "position": [1101, 376, 1283, 422], "threshold": 60, "maxVal": 255, "context": "锁定", "matchingType": "contains", "isOpenGray": 1, "isOpenThreshold": 1, "canvasMsg": "锁定" }],
            'multipleColor': [],
            'multipleImg': [{ "position": [1101, 376, 1283, 422], "threshold": 60, "maxVal": 255, "pathName": "./res/锁定队伍_锁定队伍.png", "imgThreshold": 0.8, "isOpenGray": 1, "isOpenThreshold": 1, "canvasMsg": "锁定队伍_锁定队伍" }]
        }
    }
}

// 命名规则 pageSetting_ + 业务名称
let pageSetting_极难任务 = {
    "竞技场": {
        "1080_2400": {
            'relation': { "total": "or", "analysisChart": "or", "multipleColor": "or", "multipleImg": "or", "nextKey": "选择队伍_待开始" },
            'analysisChart': [{ "position": [1101, 376, 1283, 422], "threshold": 60, "maxVal": 255, "context": "锁定", "matchingType": "contains", "isOpenGray": 1, "isOpenThreshold": 1, "canvasMsg": "锁定" }],
            'multipleImg': [{ "position": [1101, 376, 1283, 422], "threshold": 60, "maxVal": 255, "pathName": "./res/锁定队伍_锁定队伍.png", "imgThreshold": 0.8, "isOpenGray": 1, "isOpenThreshold": 1, "canvasMsg": "锁定队伍_锁定队伍" }]
        }
    }
}

// 业务操作参数
let serviceOperateParam = {
    "广告页": {
        "广告关闭_找图点击": {
            "1080_2400": { "threshold": "60", "maxVal": 255, "imgThreshold": 0.7, "pathName": "./res/1080_2400/广告关闭.png", "colorThreshold": 26, "bigScale": 1, "smallScale": 1, "isOpenGray": 0, "isOpenThreshold": 0, "position": ["1586", "122", "1989", "409"], "featuresThreshold": 0.7 }
        },
        "广告关闭1_找图点击": {
            "1080_2400": { "threshold": "220", "maxVal": 255, "imgThreshold": 0.7, "colorThreshold": 26, "bigScale": 1, "smallScale": 1, "isOpenGray": 0, "isOpenThreshold": 0, "position": ["1886", "891", "2145", "1071"], "featuresThreshold": 0.7, "pathName": "./res/1080_2400/广告关闭1.png" }
        }
    },
    "人工智能升级": {
        "点击确认_识字点击": {
            "1080_2400": { "threshold": 60, "maxVal": 255, "imgThreshold": 0.7, "colorThreshold": 26, "bigScale": 1, "smallScale": 1, "isOpenGray": 0, "isOpenThreshold": 0, "position": ["1229", "852", "1626", "995"], "featuresThreshold": 0.7, "color": "#031E1D", "colorOther": [[526, 121, "#072C2C"], [287, 820, "#222017"], [684, 963, "#15697B"]] }
        }
    },
    "签到奖励": {
        "点击关闭_找图点击": {
            "1080_2400": { "threshold": "220", "maxVal": 255, "imgThreshold": 0.7, "pathName": "./res/1080_2400/签到关闭.png", "colorThreshold": 26, "bigScale": 1, "smallScale": 1, "isOpenGray": 0, "isOpenThreshold": 0, "position": ["1560", "52", "2014", "315"], "featuresThreshold": 0.7, "colorOther": [] }
        }
    },
    "今日奖励": {
        "关闭按钮_多点颜色点击": {
            "1080_1920": { "position": [1355, 51, 1585, 244], "threshold": 60, "maxVal": 255, "color": "#727070", "colorOther": [[23, 2, "#312F2F"], [31, 3, "#727070"], [2, 22, "#312F2F"], [3, 30, "#6E6D6D"]], "colorThreshold": 26, "isOpenGray": false, "isOpenThreshold": false, "canvasMsg": "关闭按钮图标" }
        }
    },
    "游戏首页": {
        "点击出战_识字点击": {
            "1080_2400": { "threshold": 60, "maxVal": 255, "imgThreshold": 0.7, "colorThreshold": 26, "bigScale": 1, "smallScale": 1, "context": "出战", "isOpenGray": 0, "isOpenThreshold": 0, "position": ["1935", "888", "2246", "1022"], "featuresThreshold": 0.7, "colorOther": [] }
        }
    },
    "出战页": {
        "点击已选业务_识字点击": {
            "1080_2400": { "threshold": "150", "maxVal": 255, "imgThreshold": 0.7, "colorThreshold": 26, "bigScale": 1, "smallScale": 1, "context": "单人", "isOpenGray": 0, "isOpenThreshold": 0, "position": ["1239", "120", "2139", "233"], "featuresThreshold": 0.7, "colorOther": [] }
        },
        "点击新任务_找图点击": {
            "1080_2400": { "threshold": 60, "maxVal": 255, "imgThreshold": 0.7, "pathName": "./res/1080_2400/开辟新任务标志.png","colorThreshold": 26, "bigScale": 1, "smallScale": 1, "context": "", "isOpenGray": 0, "isOpenThreshold": 0, "position": ["738", "105", "2154", "1071"], "featuresThreshold": 0.7, "colorOther": [] }
        }
    }
}

/**
 * 
 * "主页": {
        "水晶就绪_识字点击": {
            "1080_1920": { "position": [784, 761, 1858, 954], "threshold": 60, "maxVal": 255, "context": "就绪", "isOpenGray": 0, "isOpenThreshold": 0, "canvasMsg": "就绪" },
        },
        "体力标志_找图或特征": {
            "1080_1920": { "position": [804, 0, 1244, 112], "threshold": 25, "maxVal": 255, "pathName": "./res/1080_1920/主页_体力图标.png", "imgThreshold": 0.8, "bigScale": 1, "smallScale": 1, "featuresThreshold": 0.8, "isOpenGray": 0, "isOpenThreshold": 0, "canvasMsg": "体力图标" }
        }
    },
    "菜单栏": {
        "菜单栏_点击图片或特征": {
            "1080_1920": { "position": [300, 0, 500, 100], "threshold": 25, "maxVal": 255, "pathName": "./res/1080_1920/菜单栏_按钮图标.png", "imgThreshold": 0.8, "bigScale": 1, "smallScale": 1, "featuresThreshold": 0.8, "isOpenGray": 0, "isOpenThreshold": 0, "canvasMsg": "菜单栏按钮图标" }
        }
    },
    "水晶潭": {
        "开启N个水晶_识字点击": {
            "1080_1920": { "position": [1481, 920, 1879, 1048], "threshold": 60, "maxVal": 255, "context": "个水晶", "isOpenGray": 0, "isOpenThreshold": 0, "canvasMsg": "个水晶" },
        },
        "打开N个_识字点击": {
            "1080_1920": { "position": [596, 831, 957, 946], "threshold": 60, "maxVal": 255, "context": "打开", "isOpenGray": 0, "isOpenThreshold": 0, "canvasMsg": "打开" },
        },
        "返回水晶密室_识字点击": {
            "1080_1920": { "position": [561, 799, 998, 980], "threshold": 60, "maxVal": 255, "context": "返回水晶", "isOpenGray": 0, "isOpenThreshold": 0, "canvasMsg": "返回水晶" },
        }
    },
    "水晶列表": {
        "水晶tab_识字点击": {
            "1080_1920": { "position": [287, 137, 743, 288], "threshold": 60, "maxVal": 255, "context": "水晶", "isOpenGray": 0, "isOpenThreshold": 0, "canvasMsg": "水晶" },
        },
        "开启_识字点击": {
            "1080_1920": { "position": [1256, 292, 1611, 965], "threshold": 60, "maxVal": 255, "context": "开启", "isOpenGray": 0, "isOpenThreshold": 0, "canvasMsg": "开启" },
        },
        "返回_点击图片或特征": {
            "1080_1920": { "position": [0, 0, 245, 120], "threshold": 25, "maxVal": 255, "pathName": "./res/1080_1920/返回图标.png", "imgThreshold": 0.8, "bigScale": 1, "smallScale": 1, "featuresThreshold": 0.8, "isOpenGray": 0, "isOpenThreshold": 0, "canvasMsg": "返回图标" }
        }
    }
 * 
 */

// 默认逻辑关系
const relationDeafult = { "total": "or", "analysisChart": "or", "multipleColor": "or", "multipleImg": "or" }


let constant = {
    'commonSettingKey': commonSettingKey,
    'commonSettingRange': commonSettingRange,
    'positionOffset': positionOffset,
    'serviceOperateParam': serviceOperateParam,
    'relationDeafult': relationDeafult
}

let select业务 = commonSettingRange.select业务
select业务.forEach((item) => {
    let key = 'pageSetting_' + item;
    constant[key] = this[key]
})
module.exports = constant